<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: IndexModel.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: IndexModel.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>/**
 * @fileOverview Index 业务处理模块
 * @author houjk
 */

import { resolve } from "url";

/**
 * IndexModel类，提供index模板数据
 * @class
 */
class IndexModel {
  /**
   * @constructor
   * @param {string} app koa2的上下文环境
   */
  constructor(app){}

  /**
   * 获取数据
   * @returns {Promise} 异步返回页面模板数据
   * @example
   * let indexModel = new IndexModel;
   * let ret = indexModel.getData();
   */
  getData() {
    return new Promise((resolve,reject)=>{
      setTimeout(() => {
        const indexData = {
          name: 'first swig page',
          version:'1.0.0.1',
          user: {
            name: 'fundon',
            email: 'cfddream@gmail.com'
          }
        };
        resolve(indexData);
      }, 1000);
    })
  }
}
export default IndexModel;</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="IndexModel.html">IndexModel</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 25 2018 22:27:22 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
